Overriding the default settings
A transformation can be defined that overrides the topic, partition and message key settings defined in the General tab.
Before you can define such a transformation, you first need to add a source endpoint to the task and select the tables you want to replicate.
To define a transformation:
- Open the task you defined.
- If you are defining a transformation for a single table, select one of the source tables. Otherwise, skip to Step 3.
-
Define a transformation that adds one of the following columns:
Information noteThe columns listed below (prefixed with a $) instruct Replicate to route the message to the desired hub and/or partition, and will not be included in the actual message itself.
- $hub - To write messages to a specific hub.
- $partition - To write messages to a specific partition.
- $key - To create a custom message key.
For information on creating a transformation for a single table, see Defining transformations for a single table/view.
For information on creating a global transformation rule, see Starting the Global Transformation Rules wizard.
- Define an expression for the new column that returns the following values:
- For a $hub column, the expression should return the topic name.
- For a $partition column, the expression should return the partition number. Note that an error will be returned during runtime if the partition number does not exist.
- For a $key column, the expression should return the message key contents. Note that the expression must return a non-empty value.
For information on creating expressions, see Using the Expression Builder.